Skip to content

Conversation

@gammazero
Copy link
Contributor

@gammazero gammazero commented Aug 14, 2025

Add a LevelEnabled method to the ZapEventLogger to more conveniently check if a log level is enabled for the logger.

This is an alternative to calling:

    logger.Level().Enabled(zapcore.Level(LevelDebug))

resulting in the simpler and more readable call to:

    logger.LevelEnabled(LevelDebug)

This has the added bebefid of not requiring an import of "go.uber.org/zap/zapcore"

Add a LevelEnabled method to the ZapEventLogger to more conveniently check if a log level is enabled for the logger.

This is an alternative to calling:
```
    logger.Level().Enabled(zapcore.Level(LevelDebug))
```
resulting in the simpler and more readable call to:
```
    logger.LevelEnabled(LevelDebug)
```

This has the added bebefid of not requiring an import of `"go.uber.org/zap/zapcore"`
@gammazero gammazero merged commit 9af0bed into master Aug 14, 2025
9 checks passed
@gammazero gammazero deleted the levelenabled-func branch August 14, 2025 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants